let config = require('config');
let log4js = require('log4js');
let path = require('path');
log4js.configure(config.get('log4js'));
let origin = log4js.getLogger;
let cwd = process.cwd();
log4js.getLogger = function(category) {
    if (category.lastIndexOf('.js')) {
        category = category.replace(cwd + '/', '').split(path.sep).join('.');
        category = category.substr(0, category.length - 3);
    }
    return origin.call(log4js, category);
};
module.exports = log4js;
